<template>
  <view class="h_body success_html">
    <view class="successMain">
      <view class="successImg">
        <!-- <image :src="imgSrc" alt=""></image> -->
      </view>
      <h3>改单成功</h3>
      <p>您对订单的修改已经生效</p>
    </view>

    <view class="detail_btn" @click="toOrderDetail">查看订单</view>
    <view class="home_btn" @click="goHome">返回首页</view>
  </view>
</template>
<script lang="ts" setup>
import useSendGoodsStore from "../../store/sendGoods";
import Taro, { useDidShow } from "@tarojs/taro";
// import { orderList } from "@/@api";
// import { reset } from "./reset";
import { ref } from "vue";
// import orderBody from "@/components/orderBody";
import useMyOrderStore from "@/store/myOrder";
import {$post} from "@/@api";
const sendGoodsStore = useSendGoodsStore();
const order = useMyOrderStore();
const imgSrc = ref<string>("../../assets/images/index/改单成功.png");
useDidShow(async () => {
  //   reset();
});
async function goHome() {
  Taro.reLaunch({
    url: "/pages/index/index",
  });
}
function onceAgin() {
  Taro.navigateTo({
    url: "/pages/changeOrder/index",
  });
}

const toOrderDetail = async () => {
  let res: any = await $post(
      "/selfmachine-system/order/list",
      {
        ssoId: sendGoodsStore.changeList.ssoId.toString(),
      }
  )
  order.orderList = res.data.rows[0]
  Taro.navigateTo({
    url: "/pages/myOrder/order",
  });
}
</script>
<style lang="scss">
page {
  background-color: #f5f5f5;
}
.success_html {
  padding-bottom: 24rpx;
  box-sizing: border-box;
  height: 100vh;
}
.success {
  margin-top: 24rpx;
  height: 148rpx;
  display: flex;
  padding: 32rpx;
  box-sizing: border-box;
  align-items: center;
  image {
    width: 80rpx;
    height: 80rpx;
    margin-right: 30rpx;
  }
  .text {
    height: 84rpx;
    .title {
      font-family: PingFang SC;
      font-size: 32rpx;
      color: #07c160;
      margin-bottom: 8rpx;
    }
    .text_body {
      font-family: PingFang SC Medium;
      font-size: 22rpx;

      color: #252525;
    }
  }
}
.successMain {
  margin: 200rpx auto 0;
  width: 300rpx;

  .successImg {
    height: 300rpx;
    width: 300rpx;
    background: url("../../assets/images/index/改单成功.png") no-repeat;
    background-size: cover;
  }
  h3 {
    margin-top: 32rpx;
    font-size: 40rpx;
    line-height: 56rpx;
    text-align: center;
    font-weight: 600;
  }
  p {
    text-align: center;
    font-size: 28rpx;
    line-height: 40rpx;
    margin-top: 12rpx;
    color: #999999;
    white-space: nowrap;
  }
}

.success_body {
  margin-top: 24rpx;
  height: 288rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: PingFang SC;
  .o {
    font-size: 28rpx;

    color: #252525;
  }
  .s {
    font-size: 48rpx;
    /* 主色/蓝 */
    color: #0966ff;
    width: 242rpx;
    height: 72rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24rpx;
  }
  .t {
    display: flex;
    font-family: PingFangSC-Regular;
    font-size: 24rpx;
    .left {
      width: 166rpx;
      height: 56rpx;
      border-radius: 88rpx;
      display: flex;
      justify-content: center;
      align-items: center;
      border: 1rpx solid #c4c4c4;
      color: #252525;
      margin-right: 16rpx;
    }
    .right {
      width: 166rpx;
      height: 56rpx;
      border-radius: 88rpx;
      display: flex;
      justify-content: center;
      align-items: center;
      border: 1rpx solid #0966ff;
      color: #0966ff;
    }
  }
}

.detail_btn {
  margin: 100rpx auto 0;
  width: 590rpx;
  height: 88rpx;
  border-radius: 44rpx;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  font-size: 32rpx;
  color: #fff;
  background-color: #0966ff;
}
.home_btn {
  margin: 32rpx auto 0;
  width: 590rpx;
  height: 88rpx;
  border-radius: 44rpx;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  font-size: 32rpx;
  color: #252525;
  background-color: #fff;
  border: 1rpx solid #c4c4c4;
}
</style>
